package javaTec;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by yangshunxing on 2017/8/11.
 */
public class TriangleCount {

    public static void main(String[] args) {
        Integer[] array = new Integer[]{4,4,4,4};

       /* Integer[] s = new Integer[array.length];
        for (int j = 0; j<array.length; j++){
            s[j] = array[j];
        }*/
        int sum=0;
        List<Integer> restNumber;
        restNumber = new ArrayList<>(Arrays.asList(array));
        for(int i=0; i<array.length;i++){
            int a = array[i];
            restNumber.remove(0);
            List<Integer> cs = new ArrayList<>();
            cs.addAll(restNumber);
            for (int i1=0;i1<restNumber.size();i1++){
                int b = restNumber.get(i1);
                cs.remove(restNumber.get(i1));
                for (int i2=0;i2<cs.size();i2++){
                    if (cs.get(i2)>Math.abs(a-b) && cs.get(i2)<a+b){
                       sum++;
                    }
                }
            }
        }
        System.out.println(sum);

        List<List<Integer>> list = new ArrayList<>();
        for (int i=0;i<array.length-3;i++){
//            List<Integer>
        }
    }

}
